package ead.cs.service.impl;

import ead.cs.service.RabbitGateway;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class RabbitGatewayImpl implements RabbitGateway {

    private static final String ALERT = "alert";

    @Autowired
    @Qualifier("direct.con")
    private RabbitTemplate rabbitTemplate;

    @Override
    public void alert(String message) {
        rabbitTemplate.convertAndSend(ALERT, message);
    }
}
